package com.mole.rbac.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.mole.rbac.dao.StudentDao;
import com.mole.rbac.entity.Student2;
import com.mole.rbac.service.StudentService;

@Service
@Transactional
public class StudentServiceImpl implements StudentService {
	@Autowired
	private StudentDao studentDao;
	@Override
	public int save(Student2 student) {
		
		return studentDao.insert(student);
	}

	@Override
	public int update(Student2 student) {
		return studentDao.update(student);
	}

	@Override
	public int deleteById(Long id) {
		return studentDao.deleteById(id);
	}

	@Override
	public Student2 getById(Long id) {
		return studentDao.selectById(id);
	}

	@Override
	public List<Student2> listAll() {
		return studentDao.selectAll();
	}

	@Override
	public List<Student2> listByPage(int pageIndex, int pageSize) {
		return studentDao.selectByPage(pageIndex, pageSize);
	}
	
}
